package _3_异常处理._2_捕获异常;

import java.io.IOException;

public class catchException {

    public static void main(String[] args) {
        try {
            process1();
            process2();
            process3();
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.out.println("Bad input");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("Unknown error");
        }
    }

    public static void process1() throws IOException{
        throw new IOException();
    }

    public static void process2() throws NumberFormatException{
        throw new NumberFormatException();
    }

    public static void process3() throws Exception{
        throw new Exception();
    }

}
